package com.dense.kuiniu.bookborrow.view.dialog;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.dense.kuiniu.bookborrow.R;

/**
 * @author Administrator
 * @date 2021/1/25
 */
public class InstallDialog extends DialogMeasure {
    private TextView mTvMsg;
    private TextView mTvConfirm;

    public InstallDialog(Context context) {
        super(context);
    }

    @Override
    protected int layoutRes() {
        return R.layout.dialog_install;
    }

    @Override
    protected void init(Context context, View view) {
        mTvMsg = view.findViewById(R.id.tv_msg);
        mTvConfirm = view.findViewById(R.id.tv_confirm);
    }

    public InstallDialog text(String text) {
        if (mTvMsg != null) {
            mTvMsg.setText(text);
        }
        return this;
    }

    public InstallDialog confirm(View.OnClickListener listener){
        if(mTvConfirm != null){
            mTvConfirm.setOnClickListener(listener);
        }
        return this;
    }


    @Override
    public float widthPercent() {
        return 0.78f;
    }

    @Override
    public float heightPercent() {
        return 0.31f;
    }
}